home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11568 < prev    next >
Encoding:
Text File  |  1996-08-05  |  846 b   |  39 lines

  1. Path: news.mindspring.com!usenet
  2. From: rudd@mindspring.com (Justin Rudd)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: TYPEDEF help needed
  5. Date: Fri, 15 Mar 1996 03:22:16 GMT
  6. Organization: MindSpring Enterprises
  7. Message-ID: <4ianrs$m0f@B1FF.mindspring.com>
  8. References: <Do9J5n.KE7.0.-s@cs.vu.nl>
  9. Reply-To: rudd@mindspring.com
  10. NNTP-Posting-Host: rudd.mindspring.com
  11. X-Newsreader: Forte Free Agent v0.55
  12.  
  13. >typedef struct Coordinates
  14. >{
  15. >    int x,y;
  16.  
  17. >} Coordinates;
  18.  
  19. Try this....
  20.  
  21. typedef struct _Coordinates
  22. {
  23.     int x,y;
  24. } Coordinates;
  25.  
  26. The reason it probably wasn't working is because the name of the
  27. struct and the variable were the same...it is on the same concept of
  28. this:  int int.  You can't declare an int with the name int.
  29.  
  30. As for the list try this....
  31.  
  32. typedef Coordinates CoordList[100];
  33.  
  34. Hope this helps....
  35.  
  36. Justin Rudd
  37. rudd@mindspring.com
  38.  
  39.